import request from '@/utils/request'

//获取客户类型
export function getAllProfileType() {
    return request({
        url: '/customer/category/all',
        method: 'post'
    })
}

export function getAllProfile(data) {
    return request({
        url: '/customer/category/group/all',
        method: 'post',
		data:data
    })
}
//获取全部集团
export function getAllGroup() {
    return request({
        url: '/customer/group/all',
        method: 'post'
    })
}
//分页
export function getList(currentPage, count, customerQuery) {
    return request({
        url: `/customer/info/page/${currentPage}/${count}`,
        method: 'post',
        data: customerQuery
    })
}
//根据id获取客户信息
export function getdataById(id) {
    return request({
        url: '/customer/info/query/' + id,
        method: 'post'
    })
}

//客户档案新增。
export function add(customerInfo) {
    return request({
        url: '/customer/info/add',
        method: 'post',
        data: customerInfo
    })
}
//客户档案编辑。
export function edit(customerInfo) {
    return request({
        url: '/customer/info/edit',
        method: 'post',
        data: customerInfo
    })
}

//根据id注销客户
export function cancellingById(id) {
  return request({
    url: '/customer/info/cancelling/' + id,
    method: 'post'
  })
}

//根据id激活
export function activationById(id) {
  return request({
    url: '/customer/info/activation/' + id,
    method: 'post'
  })
}

//根据id激活
export function getSystemCustomer() {
  return request({
    url: '/systemUser/findCusstomerUser',
    method: 'get'
  })
}

//根据id激活
export function getSystemCustomerById(costomerID) {
    return request({
      url: `/systemUser/findCusstomerUser/${costomerID}`,
      method: 'get'
    })
  }

//客户档案删除。
export function customerTypeDel(cid) {
    return request({
        url: `/customer/info/del/${cid}`,
        method: 'post',
        data: cid
    })
}
//下载
export function outExcel() {
    return request({
        url: '/customer/info/download/excel',
        method: 'get',
    })
}
//导入
export function inExcel(data) {
    return request({
        url: '/customer/info/import/excel',
        method: 'post',
        data
    })
}
//导出
export function leadingOut() {
    return request({
        url: '/customer/info/export/excel',
        method: 'get',
    })
}
